﻿using System.Collections;
using System.Collections.Generic;
using UnityEngine;

namespace DashFire
{
  public class UseWWW{
    public static UseWWW Instace
    {
      get { return sInstance; }
    }
    private static UseWWW sInstance = new UseWWW();

    public delegate void Caller(WWW w);

    public Coroutine Get(string url, Caller call)
    {
      return CoroutineProxy.Instance.StartCoroutine(GetImplement(url, call) );
    }

    private IEnumerator GetImplement(string url, Caller call)
    {
      WWW tWWW = new WWW(url);
      yield return tWWW;
      call(tWWW);
      tWWW.Dispose();
    }
  }
}